import { useParams } from "react-router-dom"
import { Card, Descriptions } from "antd";
import { useEffect, useState } from "react";
import { getUserById } from "@/api/user";
export default function Show() {
    const { id } = useParams();
    const [userInfo,setUserInfo] = useState<any>({
        param:{
        }
    });
    useEffect(()=>{
        const getUserInfoAsync = async ()=>{
            const result:any = await getUserById(Number(id));
            console.log(result);
            setUserInfo(result.userInfo);
        }
        getUserInfoAsync();
    },[])
    return (
        <Card>
            <Descriptions title="用户详情" column={2} bordered>
                <Descriptions.Item label="id">{userInfo.id}</Descriptions.Item>
                <Descriptions.Item label="姓名">{userInfo.name}</Descriptions.Item>
                <Descriptions.Item label="昵称">{userInfo.nicename}</Descriptions.Item>
                <Descriptions.Item label="手机号">{userInfo.phone}</Descriptions.Item>
                <Descriptions.Item label="是否锁定">{userInfo.param.statusString}</Descriptions.Item>
                <Descriptions.Item label="是否认证">{userInfo.param.authStatusString}</Descriptions.Item>
                <Descriptions.Item label="创建时间">{userInfo.createTime}</Descriptions.Item>
                <Descriptions.Item label="修改时间">{userInfo.updateTime}</Descriptions.Item>
               
            </Descriptions>
        </Card>
    )
}